package day19;

/**
 * 题目:汽水瓶
 * https://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f?tpId=37&&tqId=21245&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 */

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int count = getNum(n);
            if(count != 0) {
                System.out.println(count);
            }
        }
    }

    private static int getNum(int n) {
        int sum = 0;
        while (n > 1 ) {
            sum += n / 3;
            n = n / 3 +n % 3;
            if(n == 2) {
                ++sum;
                break;
            }
        }
        return sum;
    }
}
